<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增货箱出库单')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-outbound-add">
        <input name="type" type="hidden" th:value="2">
        <input name="warehouseCode" type="hidden" th:value="${warehouse.warehouseCode}">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">仓库编码：</label>
            <div class="col-sm-8">
                <input name="warehouseCodeName" class="form-control" type="text" th:value="${warehouse.warehouseName}" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">货箱类型编码：</label>
            <div class="col-sm-8">
                <select id="goodsBoxSpecCode" name="goodsBoxSpecCode" class="form-control">
                    <option th:each="model:${list}" th:text="${model.specName}" th:value="${model.specCode}"></option>
                    <!--<option th:each="model:${list}" th:value="${model.warehouseCode}"
                            th:text="${model.warehouseName}"></option>-->
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">货箱数量：</label>
            <div class="col-sm-8">
                <input name="total" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <input name="remark" class="form-control" type="text">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: jquery-cxselect-js"/>
<script th:inline="javascript">
    var prefix = ctx + "system/box/outbound"
    $("#form-outbound-add").validate({
        focusCleanup: true,
        rules: {
            total: {
                digits: true,
                max: 9997
            },
        }
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-outbound-add').serialize());
        }
    }
</script>
</body>
</html>